home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / hppcmode.arc / PC.ASM < prev   
Encoding:
Assembly Source File  |  1986-01-21  |  39.9 KB  |  3,285 lines

  1. ;
  2. ; code to emulate the IBM PC ROM BIOS on the HP150.
  3. ;
  4.  
  5. ; changed March 7, 1985 by MK to improve Line Draw mapping.
  6.  
  7.  page 61,132
  8.  
  9. AVIDEOSEG    EQU  0D000H
  10. BIOS_TIMER    EQU  400H    ;OFFSET TO 4 BYTE HP150 TIMER
  11. HI_VID_FUNC    EQU  15     ;HIGHEST INT 10 FUNCTION
  12. video_frequency equ 6000    ; 60 cycles per second * 100
  13. pc_frequency    equ 1821    ; 18.21 cycles per second * 100
  14.  
  15. esc        equ  27
  16. e_cr        equ  0dh
  17. e_lf        equ  0ah
  18. e_bs        equ  08h
  19. ctrls        equ  13h
  20. ctrlx        equ  18h
  21. e_true      equ  01h
  22. e_false     equ  00h
  23. ;
  24. ; entry point to firmware.
  25. ;
  26. row_jumps segment at 0000h
  27. ;
  28.     org 42fh
  29. mem_mgr   label far
  30. ;
  31. row_jumps ends
  32. ;
  33. ;*****************************************************************************
  34. pccode  SEGMENT byte public 'CODE'
  35.     ASSUME  CS:pccode,DS:pccode
  36. ;
  37. ; DATA AREA FOR RESIDENT CODE
  38. ; VARIABLES
  39. LOW_ROW     DB   0
  40. HIGH_ROW    DB   0
  41. CURSPOS     DW   0
  42. ;
  43. ;
  44. ;    these three used in MSDOS buffer keyboard input.
  45. bufptr      dw 0,0
  46. bufmax      dw 0
  47. bufindex    dw 0
  48. ;
  49. ; these variables used to return special strings, like an ANSI
  50. ; cursor position request.
  51. ret_buf     dw 0
  52. ret_cnt     dw 0
  53. old_in_hand    db 0
  54. ;
  55. ;
  56. timer_cnt    dw video_frequency
  57. pc_active    db e_false
  58. IOCTL_dev_info  dw 0
  59. ;
  60. ; these variables used by ANSI escape sequences
  61. esc_seen    db e_false
  62. in_ansi     db e_false
  63. ansi_enh    db 0ffh 
  64. saved_curpos    dw 0
  65. ansibuf_len    dw 0
  66. ansibuf     db 10h dup(0)
  67. cursensebuf    db esc,"[00;00R"
  68.  
  69. ; VALUE IS 0 IF NO DATA IS IN HAND
  70. IN_HAND     DB   e_false
  71. IN_DATA     DW   0
  72.  
  73.     extrn kb_init:near
  74.     extrn kb_reset:near
  75.     extrn kb_is_q_empty:near
  76.  
  77. ;
  78. ; Entry points. MS-PASCAL calling conventions used.
  79. ;
  80.     public pcinit,pcterm
  81. ;
  82. pcinit proc far
  83.     push ds     ; save some regs
  84.     push es
  85.     push bp
  86. ;
  87.     push cs     ; our data is in the code seg
  88.     pop ds
  89. ;
  90.     mov ax,3521h        ; get MSDOS vector for later calls
  91.     int 21h
  92.     mov word ptr msdos_entry,bx
  93.     mov word ptr msdos_entry+2,es
  94. ;
  95.     call init_interrupts
  96. ;
  97.     call kb_init        ; initialize the keyboard driver
  98. ;
  99.     call enable_pc
  100. ;
  101.     pop bp
  102.     pop es
  103.     pop ds
  104.     ret
  105. pcinit  endp
  106. ;
  107. ;
  108. pcterm proc far
  109.     push ds     ; save some regs
  110.     push es
  111.     push bp
  112. ;
  113.     push cs
  114.     pop ds
  115. ;
  116.     call disable_pc
  117.     call kb_reset        ; clear keyboard driver.
  118.     call clr_interrupts
  119. ;
  120.     pop bp
  121.     pop es
  122.     pop ds
  123.     ret
  124. pcterm endp
  125.  
  126. enable_pc proc near
  127.     mov ax,4400h        ; save console device info
  128.     xor bx,bx        ; console handle is zero
  129.     int 21h
  130.     mov dh,0        ; clear high byte if info.
  131.     mov IOCTL_dev_info,dx
  132. ;
  133.     call init_video
  134.     mov pc_active,e_true
  135.     mov ansi_enh,0ffh
  136.     mov ah,83h
  137.     int 16h
  138.     ret
  139. enable_pc endp
  140. ;
  141. disable_pc proc near
  142.     mov pc_active,e_false
  143.     mov ah,84h
  144.     int 16h
  145.     call reset_video
  146. ;
  147.     mov dx,IOCTL_dev_info    ; restore dev info
  148.     mov ax,4401h
  149.     xor bx,bx        ; console handle = 0
  150.     int 21h
  151.     ret
  152. disable_pc endp
  153.  
  154. ;  HERE ON INTERRUPT 10
  155. INT10:  STI                ;RESTORE INTERRUPTS
  156.     PUSH SI
  157.     PUSH DI
  158.     PUSH DX
  159.     PUSH CX
  160.     PUSH BX
  161.     PUSH ES
  162.     PUSH DS
  163.     PUSH AX 
  164.     PUSH CS
  165.     POP  DS
  166. ;
  167.     test ah,80h        ; test for extended functions
  168.     jz normal_int10
  169. ;
  170.     mov di,offset extend_int10_vects
  171.     cmp ah,86h
  172.     jg badcall
  173. ;
  174.     and ah,7fh        ; clear extend fct flag.
  175.     jmp short int10_exit
  176. ;
  177. normal_int10:
  178.     mov di,offset int10_vects
  179.     CMP  AH,HI_VID_FUNC
  180.     JG   BADCALL        ;ERROR
  181. ;
  182. int10_exit:
  183.     push ax
  184.     MOV  AL,AH
  185.     XOR  AH,AH
  186.     SHL  AX,1
  187.     ADD  DI,AX
  188.     pop  ax
  189.     JMP  WORD PTR [DI]    ;CALL SERVER FOR INT10 SUBFUNC
  190.  
  191. ; UNSUPPORTED INT 10 SUBFUNCTIONS
  192. SET_MODE:        ;SET VIDEO MODE
  193. SET_CTYPE:        ;SET CURSOR TYPE
  194. ACT_DISP_PAGE:      ;SELECT ACTIVE DISPLAY PAGE
  195. SET_COLOR:        ;SET COLOR PALETTE / BACKGROUND COLOR
  196. WRITE_DOT:        ;WRITE A SINGLE PIXEL
  197. READ_DOT:        ;READ A SINGLE PIXEL
  198. BADCALL:
  199.     JMP  RETURN
  200. ;
  201. INT10_VECTS:
  202.     DW    OFFSET SET_MODE     ; 0
  203.     DW    OFFSET SET_CTYPE    ; 1
  204.     DW    OFFSET write_cursor    ; 2
  205.     DW    OFFSET READ_CURSOR    ; 3
  206.     DW    OFFSET READ_LPEN    ; 4
  207.     DW    OFFSET ACT_DISP_PAGE    ; 5
  208.     DW    OFFSET SCROLL_UP    ; 6
  209.     DW    OFFSET SCROLL_DOWN    ; 7
  210.     DW    OFFSET READ_AC_CURRENT  ; 8
  211.     DW    OFFSET WRITE_AC_CURRENT ; 9
  212.     DW    OFFSET WRITE_C_CURRENT  ; 10
  213.     DW    OFFSET SET_COLOR    ; 11
  214.     DW    OFFSET WRITE_DOT    ; 12
  215.     DW    OFFSET READ_DOT     ; 13
  216.     DW    OFFSET WRITE_TTY    ; 14
  217.     DW    OFFSET VIDEO_STATE    ; 15
  218.  
  219. extend_int10_vects:
  220.     dw    offset extend_enable    ; 80h
  221.     dw    offset extend_disable    ; 81h
  222.     dw    offset read_ac_random    ; 82h
  223.     dw    offset write_ac_random  ; 83h
  224.     dw    offset write_c_random    ; 84h
  225.     dw    offset bell_fct     ; 85h
  226.     dw    offset status_fct    ; 86h
  227. ;
  228. ; extended INT 10 fucntion 85h, ring bell
  229. ;
  230. ; entry: fct ah = 85h    
  231. ;      al = frequency. values are 0 through 0fh, for frequencies
  232. ;      from 290 Hz to 1.7 KHz.
  233. ;      bl = duration, in units of 100m secs
  234. ;
  235. bell_fct:
  236.     and al,0fh
  237.     or al,030h
  238. ;
  239. bell_fct_loop:
  240.     out 19h,al
  241.     call delay
  242.     cmp bl,0
  243.     jle bell_fct90
  244.     dec bl
  245.     jnz bell_fct_loop
  246. ;
  247. bell_fct90:
  248.     jmp return
  249. ;
  250. ;
  251. ; delay 100 milliseconds
  252. ;
  253. delay proc near
  254.     mov cx,2800h
  255. delay_loop:
  256.     push si
  257.     pop si
  258.     loop delay_loop
  259.     ret
  260. delay endp
  261. ;
  262. ;  beep the bell
  263. ;
  264. beep proc near
  265.     mov    ax,8509h    ; use extended fct to ring bell.
  266.     mov    bl,1
  267.     int    10h
  268.     ret
  269. beep endp
  270.  
  271. ;
  272. ; extended INT 10 function, enable PC emulation (default).
  273. ;
  274. extend_enable:
  275.     call enable_pc
  276.     jmp return
  277. ;
  278. extend_disable:
  279.     call disable_pc
  280.     jmp return
  281. ;
  282. ; extended INT 10 fct, return status of PC emulation
  283. ;
  284. ;    on exit: al = 1 if emulation is active
  285. ;         al = 0 if emulation is inactive
  286. status_fct:
  287.     mov al,pc_active
  288.     mov ah,0
  289.     jmp retnewax
  290. ;
  291. ; RETURN CURRENT CURSOR POSITION IN DX
  292. READ_CURSOR:
  293.     MOV    DX,CURSPOS
  294.     MOV    CX,0        ;DEFAULT/DUMMY CURSOR TYPE
  295.     POP    AX
  296.     POP    DS
  297.     POP    ES
  298.     POP    BX
  299.     POP    DI        ;DISCARD OLD CX
  300.     POP    DI        ;DISCARD OLD DX
  301.     POP    DI
  302.     POP    SI
  303.     IRET         ;JUST RETURN TO INTERRUPTER
  304.  
  305.  
  306. ;  SCROLLING
  307. ;    CX = Row , Column of upper left corner
  308. ;    DX = Row , Column of lower right corner
  309. ;    BH = Attr char on blank line
  310. ;    AL = Number of rows to scroll (0 = Blank All)
  311. SCROLL_DOWN:
  312.     NEG    AL        ;MOVE ROWS DOWN
  313. SCROLL_UP:
  314.     MOV    bl,BH        ;PASS ATTR IN bL
  315.     CALL    CONV_ATTR    ;CONVERT ATTRIBUTE TO HP
  316.     MOV    AH,bl        ;AH = ATTRIBUTE (HP)
  317.     CALL    SCROLL_SUBR
  318.     JMP    RETURN
  319.  
  320. ; SUBROUTINE TO HANDLE ALL SCROLLING
  321. ;
  322. ;   entry:  al = scroll count.
  323. ;        dx = row, col of lower right corner
  324. ;        cx = row, column of upper left
  325. ;        ah = HP enhancement
  326. SCROLL_SUBR:
  327.     MOV    LOW_ROW,DH
  328.     MOV    HIGH_ROW,CH
  329.     XCHG    AL,DH
  330.     SUB    AL,CH        ;# OF ROWS IN SCROLL WINDOW
  331.     JS    scroll_quit    ;LOWER ROW IS HIGHER THAN HIGHER
  332.     INC    AL        ;AL = COUNT OF ROWS IN WINDOW
  333.     SUB    DL,CL        ;RIGHT COL - LEFT COL
  334.     JS    scroll_quit    ;RIGHT IS LEFT OF LEFT COL
  335.     INC    DL
  336.     OR    DH,DH
  337.     JNS    SC_2        ;JUMP IF SCROLLING UP
  338.     MOV    CH,LOW_ROW    ;CH = LOWEST ROW
  339. SC_2:    XCHG    CL,DL        ;CL= # OF COLS IN WINDOW, DL = START COL
  340.     PUSH    SI
  341.     CLD
  342. ;
  343. ; DL = STARTING COLUMN, CH = NEXT ROW TO BE MOVED INTO, AH = ATTR CHARACTER
  344. ; CL = # OF COLS TO MOV, AL = # OF SCROLLS REMAINING, DH = # OF ROWS TO MOV
  345. NEXT_SCR: PUSH  CX
  346.     PUSH    AX
  347.     push    dx
  348.     MOV    dh,CH
  349.     CALL    ROWADDR
  350.     pop    dx
  351.     MOV    BL,CH
  352.     XOR    CH,CH
  353.     OR    DH,DH
  354.     JZ    DO_FILL     ;BLANKING ALL
  355.     ADD    BL,DH        ;COMPUTE ROW WE'RE MOVING FROM
  356.     CMP    BL,HIGH_ROW    
  357.     JL    DO_FILL     ;BELOW LOWER ROW
  358.     CMP    BL,LOW_ROW
  359.     JG    DO_FILL     ;ABOVE HIGHER ROW
  360.     PUSH    DI
  361.     push    dx
  362.     mov    dh,bl
  363.     CALL    ROWADDR
  364.     pop    dx
  365.     MOV    SI,DI
  366.     POP    DI
  367.     push    ds        ; save our DS
  368.     push    es
  369.     pop    ds        ;both ES and DS to video area.
  370.     REP    MOVSW        ;MOVE IT
  371.     pop ds
  372. NSCR_1: POP    AX
  373.     POP    CX
  374.     OR    DH,DH
  375.     JNS    NSCR_2
  376.     DEC    CH        ;SCROLLING DOWN
  377.     JMP    SHORT NSCR_3
  378. NSCR_2: INC    CH        ;SCROLLING UP
  379. NSCR_3: DEC    AL
  380.     JNZ    NEXT_SCR
  381.     POP    SI
  382. scroll_quit:
  383.     RET
  384. ;
  385. DO_FILL: POP    AX        ;GET THE ATTR CHARACTER
  386.     PUSH    AX
  387.     push    ds
  388.     push    es
  389.     pop    ds
  390.     MOV    AL,020H     ;ATTRIBUTES
  391.     REP STOSW        ;FILL THE LINE
  392.     pop    ds
  393.     JMP    NSCR_1
  394.  
  395. ;  DH = row , DL = column
  396. ;  on exit ES:DI = addr of char in video mem.
  397. ROWADDR:
  398.     mov    ax,avideoseg
  399.     mov    es,ax
  400. ;
  401.     mov    ah,0
  402.     mov    al,dh
  403.     mov    di,ax
  404.     SHL    di,1
  405.     SHL    di,1
  406.     ADD    di,row_tab    ;DI= ADDR INTO 25 ENTRY HARDWARE PTRS
  407.     MOV    AL,DL
  408.     CBW
  409.     ADD    AL,es:[di]    
  410.     ADC    AH,es:[di+2]
  411.     SHL    AX,1        ;AX = ADDR IN VIDEO MEMORY OR ROW,COL
  412.     MOV    DI,AX
  413.     RET
  414.  
  415. ; WRITE CHARACTER, NO ATTRIBUTE
  416. WRITE_C_current:
  417.     mov    dx,curspos
  418. write_c_random:
  419.     MOV    bl,0FFH     ;NO ENHANCEMENT CHANGE
  420. write_c_common:
  421.     push    ax
  422.     push    bx
  423.     CALL    FASTC
  424.     pop    bx
  425.     pop    ax
  426.     inc    dl        ; increment the column
  427.     cmp    dl,79
  428.     jle    write_c_continue
  429.     mov    dl,0
  430.     inc    dh
  431. write_c_continue:
  432.     loop    write_c_common
  433.     JMP    RETURN
  434.  
  435. ; WRITE CHAR AND ATTRIBUTE
  436. WRITE_AC_CURRENT:
  437.     mov    dx,curspos
  438. write_ac_random:
  439.     CALL    CONV_ATTR     ;CONVERT ATTRIBUTE TO HP
  440.     jmp    write_c_common
  441.  
  442. ; WRITE CHARACTER AT CURRENT CURSOR
  443. WRITE_TTY:
  444.     call    conout
  445.     jmp    return
  446.  
  447. write_cursor:
  448.     call    setcursor
  449.     JMP    RETURN
  450. ;
  451. ; Read the "light pen" For the HP150, read the touch screen.
  452. read_lpen:
  453.     mov    ah,81h      ; Extended HP function for reading touch screen.
  454.     int    16h
  455.     cmp    al,0ffh     ; check if no data available.
  456.     jne    got_lpen
  457. ;
  458.     mov    ah,0
  459.     jmp    retnewax
  460. ;
  461. got_lpen:
  462.     mov    dx,ax        ; return row col position.
  463.     mov    ch,ah        ; return graphics row.
  464.     mov    cl,3
  465.     shl    ch,cl
  466.     mov    bl,al        ; bx gets pixel col.
  467.     mov    bh,0
  468.     mov    cl,3
  469.     shl    bx,cl
  470.     mov    ah,1
  471. ;
  472.     pop    si        ; return, preserving AX,BX,CX and DX
  473.     pop    ds
  474.     pop    es
  475.     pop    si
  476.     pop    si
  477.     pop    si
  478.     pop    di
  479.     pop    si
  480.     iret
  481. ;
  482. ; read a screen character
  483. read_ac_current:
  484.     mov    dx,curspos
  485. read_ac_random:
  486.     call    fastread
  487.     jmp    retnewax
  488. ;
  489. ; read the char at current screen loc. return al = data, ah = attribute
  490. ;(dh,dl) has  (row,col)
  491. ;
  492. fastread proc near
  493.     call    rowaddr
  494.     mov    ax,es:[di]
  495.     call    conv_hp_to_ibm
  496.     push    bx        ; save attribute in BL  
  497. ;
  498.     and    ax,037fh    ; isolate character set code
  499.     cmp    ah,0
  500.     jz    fastread90    ;   done if normal char set
  501. ;
  502.     mov    si,offset game_chars    ; search game chars for match
  503.     call    check_match
  504.     jnc    fastread90    ;   no carry if good match
  505. ;
  506.     mov    si,offset extend_chars  ; check line draw, math or foreign
  507.     call    check_match
  508.     jc    fastread20    ;  jump if unknown value
  509. ;
  510.     or    al,80h      ; put into eight bit range
  511.     jmp    short fastread90
  512. ;
  513. fastread20:
  514.     mov    al," "      ; unknown char, return blank
  515. ;
  516. fastread90:
  517.     pop    bx        ; restore attribute
  518.     mov    ah,bl
  519.     ret
  520. fastread endp
  521. ;
  522. ; check_match -> serach char set table for match
  523. ;
  524. ; on entry: al holds 7 bit code. ah holds character set code
  525. ;       si points to char set table
  526. ;
  527. ; on exit:    carry set if no match
  528. ;        if carry not set, al has index value of found char
  529. ;
  530. check_match proc near
  531.     mov dl,0        ; dl is index into table
  532. check_loop:
  533.     mov cx,[si]        ; get next table entry
  534.     inc si          ; point to next word entry
  535.     inc si
  536.     cmp cl,-1        ; test if at end of table
  537.     je check_nomatch
  538. ;
  539.     and cx,037fh        ; clear out extraneous bits
  540.     cmp cx,ax    
  541.     je check_goodmatch
  542. ;
  543.     inc dl          ; inc table index
  544.     jmp check_loop
  545. ;
  546. check_goodmatch:
  547.     mov al,dl        ; replace input wchar with translation
  548.     clc            ; signal good match
  549.     ret
  550. ;
  551. check_nomatch:
  552.     stc            ; carry means no match
  553.     ret
  554. check_match endp
  555. ;
  556. ; convert hp attribute to IBM attribute. AH holds attribute.
  557. ;  return IBM attribute in bl
  558. ;
  559. conv_hp_to_ibm:
  560.     mov    bl,07h      ; scratch space in bl
  561.     test    ah,40h      ; map half bright to full intensity
  562.     jz    conv_hp10
  563.     or    bl,08h
  564. conv_hp10:
  565.     test    ah,20h      ; test underline
  566.     jz    conv_hp20
  567.     and    bl,88h
  568.     or    bl,01h
  569. conv_hp20:
  570.     test    ah,10h      ; test inverse video
  571.     jz    conv_hp30
  572.     and    bl,0f8h
  573.     or    bl,70h
  574. conv_hp30:
  575.     test    ah,08h      ; test blinking
  576.     jz    conv_hp40
  577.     or    bl,80h
  578. conv_hp40:
  579.     test    ah,80h      ; test security
  580.     jz    conv_hp50
  581.     and    bl,88h
  582. conv_hp50:
  583.     ret
  584. ;
  585. ; CONVERT ATTRIBUTE FROM IBM style to HP. value is in BL
  586. CONV_ATTR:
  587.     push    ax
  588.     xor    al,al        ; scratch space for attribute.
  589.     OR    bl,bl
  590.     JNS    CA_1        ;NOT BLINKING
  591.     OR    al,8        ;DH = BLINK
  592. CA_1:    TEST    bl,8
  593.     JZ    CA_2        ;Map high intensity to half bright
  594.     OR    al,40H      ;SET HALF-BRIGHT
  595. CA_2:    AND    bl,077H
  596.     CMP    bl,1
  597.     JNE    CA_4
  598.     OR    al,20H      ;UNDERLINE
  599. CA_4:    CMP    bl,070H
  600.     JNE    CA_6
  601.     OR    al,10H      ;INVERSE VIDEO
  602. CA_6:    cmp    bl,0
  603.     jne    ca_7
  604.     or    al,80h      ;SECURITY
  605. CA_7:    mov    bl,al
  606.     pop    ax
  607.     RET
  608.  
  609. ; ENTERED WITH ENHANCEMENT IN BL, CHAR IN AL
  610. ; (DH,DL) has (row,col)
  611. FASTC:
  612.     PUSH    AX
  613.     CALL    ROWADDR
  614.     POP    AX
  615. ;
  616.     cmp    bl,0ffh     ; if default enhance, pick up real one
  617.     jne    fastc5
  618. ;
  619.     mov bl,es:[di+1]
  620.     and bl,0f8h        ; leave Disp enhancements, clear Line and Math
  621. ;        
  622. ;  check for IBM PC game chars in range 00h to 1fh
  623. ;
  624. fastc5:
  625.     test    al,0e0h
  626.     jnz    fastc10
  627. ;
  628.     mov    ah,0
  629.     mov    si,ax
  630.     shl    si,1
  631.     mov    ax,word ptr [si+game_chars]
  632.     and    al,7fh
  633.     or    bl,ah
  634.     jmp    short fastc50
  635. ;
  636. ; check for eight bit extended chars.
  637. ;
  638. fastc10:
  639.     test    al,80h
  640.     jz    fastc50
  641. ;
  642.     and    al,7fh
  643.     mov    ah,0
  644.     mov    si,ax
  645.     shl    si,1
  646.     mov    ax,word ptr [si+extend_chars]
  647.     and    al,7fh
  648.     or    bl,ah
  649. ;
  650. fastc50:
  651.     mov    es:[di],al
  652.     mov    es:[di+1],bl
  653.     ret
  654.  
  655.  
  656. ; RETURN THE FIXED VIDEO STATE OF THE 150
  657. VIDEO_STATE:
  658.     POP    AX
  659.     POP    DS
  660.     POP    ES
  661.     POP    BX
  662.     MOV    BH,0
  663.     MOV    AX,05002H     ;80 COLUMNS X 25 :  B & W
  664.     JMP    RETCX
  665.  
  666.  
  667. ;*****************************************************************************
  668.  
  669. ;*   INTERRUPT 11 processing
  670.  
  671. ;*****************************************************************************
  672.  
  673. ;  RETURN EQUIPMENT AS 2 DISCS SYSTEM, 80X25 B&W VIDEO, NO RS232/ PRINTER
  674. INT11:    STI                ;RESTORE INTERRUPTS
  675.     MOV    AX,007DH        ;SEE IBM ROM BIOS LISTING FOR MEANINGS
  676.     IRET
  677. ;******************************************
  678.  
  679. ;*  INTERRUPT 12 memory size check
  680.  
  681. ; return the number of 1K memory blocks available.
  682. ;******************************************
  683. ;
  684. INT12:
  685.     push si     ; save some regs
  686.     push ds
  687.     push cx
  688.     push dx
  689.     push bx
  690. ;
  691.     mov ax,256    ; minimun for HP150 is 256K bytes memory
  692.     mov cx,4000h    ; CX holds segment value, starting at 256K
  693.     xor si,si    ; for zero offsets.
  694.     mov bx,55aah
  695. ;
  696. int12_loop:
  697.     mov ds,cx    ; point to high memory
  698.     cli        ; disable interrupts.
  699.     mov dl,[si]    ; save test word    
  700.     mov [si],bl    ; see if we can write to this loc
  701.     cmp [si],bl
  702.     jne int12_exit  ; no more memory if no match
  703. ;
  704.     mov [si],bh
  705.     cmp [si],bh
  706.     jne int12_exit
  707. ;
  708.     mov [si],dl        ; here if valid memory. restore original
  709.     sti            ; re-enable interrupts
  710.     add ax,64        ; move in 64K increments
  711.     add cx,1000h        ; update segment value
  712.     cmp cx,9000h        ; test if full load of memory
  713.     jne int12_loop
  714. ;
  715. int12_exit:
  716.     sti            ; re-enable interrupts
  717.     pop bx
  718.     pop dx
  719.     pop cx
  720.     pop ds
  721.     pop si
  722.     iret            ; return with memory size in AX
  723.  
  724. ;*****************************************
  725.  
  726. ;*   INTERRUPT  1C  dummy timer tic routine.
  727.  
  728. ;*******************************************
  729. ;  Interrupt 1c, timmer tic. Dummy routine. May be replaced by
  730. ; application routine.
  731.  
  732. INT1C:
  733.     IRET
  734.  
  735. ;******************************************
  736.  
  737. ;*  INTERRUPT 42  HP150 VIDEO
  738.  
  739. ;
  740. ; Interrupt 42, HP150 video interrupt. This interrupt happens 60 times
  741. ; a second. Use it to make sure that our filter on MSDOS interrupt 21
  742. ; stays in place, and to implement the IBM timer tic, 18.2 times a second.
  743. ;*******************************************
  744.  
  745. int42:
  746.     pushf        ; do real video interrupt
  747.     call dword ptr cs:[v_int42]
  748. ;
  749.     push ax     ; save some regs
  750.     push si
  751.     push es
  752.     push ds
  753. ;
  754.     push cs     ; our data is in the code segment
  755.     pop ds
  756. ;
  757. ; Check that MSDOS int 21 hasn't been restored to old value.
  758.     xor ax,ax
  759.     mov es,ax
  760.     mov si,84h    ; point straight to 0:84 for interrupt location
  761.     mov ax,word ptr [v_int21+2]     ; compare code segments.
  762.     cmp ax,es:[si+2]
  763.     jne int42_timer ; jump if still ok.
  764. ;
  765.     cli        ; disable interrupts
  766.     mov word ptr es:[si],offset int21
  767.     mov word ptr es:[si+2],cs
  768.     sti
  769. ;
  770. int42_timer:
  771.     sub word ptr timer_cnt,pc_frequency
  772.     jnc int42_exit
  773. ;
  774. ;   get here for about 1 out of 3 video interrupts (1821/6000)
  775.     add word ptr timer_cnt,video_frequency
  776.     int 1ch         ; execute user interrupt routine.
  777. ;
  778. int42_exit:
  779.     pop ds
  780.     pop es
  781.     pop si
  782.     pop ax
  783.     iret
  784.  
  785. ;********************************************
  786. ;
  787. ; Display handling routines.
  788. ;
  789. ;*******************************************
  790.  
  791. conin_ctrlc:
  792.     call constat
  793.     jz conin_ctrlc
  794.     call ctrlc_check
  795.     call conin
  796.     ret
  797. ;
  798. ; conin -> read a char from keyboard.
  799. conin:
  800.     cmp in_hand,e_true
  801.     je conin_havechar
  802. ;
  803.     mov ah,0
  804.     int 16h
  805.     jmp short conin50
  806. ;
  807. conin_havechar:
  808.     mov cx,ret_cnt
  809.     or cx,cx
  810.     jz conin_real_input
  811. ;
  812.     mov si,ret_buf
  813.     mov al,[si]
  814.     inc ret_buf
  815.     dec ret_cnt
  816.     jnz conin_ret90
  817. ;
  818.     mov cl,old_in_hand
  819.     mov in_hand,cl
  820. conin_ret90:
  821.     ret
  822. ;
  823. ;
  824. conin_real_input:
  825.     mov ax,in_data
  826. conin50:
  827.     cmp al,0        ; if non-ascii char, return as two bytes
  828.     jne conin90
  829.     mov bl,ah        ;
  830.     mov bh," "
  831.     mov in_data,bx      ; save for next read.
  832.     mov in_hand,e_true    ; flag more data available.
  833.     ret
  834. ;
  835. conin90:
  836.     mov in_hand,e_false
  837.     ret
  838.  
  839.  
  840. ctrlc_check:
  841.     cmp byte ptr in_hand,e_false
  842.     je ctrlc_check90
  843.     cmp b_q  S:
  844.     callH        TTYON}ni10
  845. 10
  846. }HP)10
  847. S    :
  848.     call
  849. pc_H
  850.     SCURR:
  851.     call        ;quenc╣     ifextendUP     th10
  852. 10
  853. curso    
  854. SCT Woc. th10
  855. 10
  856. 10
  857. 10
  858. 10
  859. 10
  860. 10
  861. 10
  862. 10
  863. 10
  864. 10
  865. 10
  866. 10
  867. 10
  868. ERRU      d.2latioONndo    ROendp
  869. E I th10
  870. ìON10
  871. 10
  872. 10
  873. 10
  874. elayH        ffs SUBRnireaON10
  875. 10
  876. 10
  877. SUB     th10
  878. 10
  879.     DX  th10
  880. torb_ th10
  881. 10
  882. 10
  883. ENatFFHet sHIGH_
  884. SC10
  885. OR THIGH_L = :neONENN_z ONalseor 10
  886. 10
  887. alse 1.zeON10
  888. 10
  889. k i,Ht_lp: P1hON10
  890. 10
  891. ow c enh
  892. ;
  893. ; eoneLL      th10
  894. 10
  895. 10
  896. 10
  897. 10
  898. 10
  899. 10
  900. 10
  901. 10
  902. PUSH    OND 
  903. pc_10
  904. .
  905.     mov    b
  906. ;
  907. ; e        ;ght EST th10
  908. 0_vON10
  909. 10
  910. que0 te so
  911. SCemeON10
  912. 10
  913. 10
  914.  
  915.     pop    s th10
  916. e =·or 
  917. scree· 1.WIN
  918.     d·.210
  919. 10
  920. 10
  921. 10
  922. 10
  923. 10
  924. 10
  925. 10
  926. 10
  927. 10
  928. 10
  929. 10
  930. 10
  931. 10
  932. 10
  933. 10
  934.     A MS- th10
  935. 10
  936. 10
  937. lineHP)10
  938. is alat
  939. pc_it:SS lat        ;v cneaven ifoff cyc th10
  940. 10
  941. 10
  942. 10
  943. 10
  944. 10
  945. endpvenL = ALLSTAvenN_h eCX, th10
  946. READ_CON10
  947. 10
  948. yboON10
  949. 10
  950. 000oi th10
  951. 10
  952. ?.
  953. ;        RO10
  954. 10
  955. 10
  956. 10
  957. ingsSTC th10
  958. bx,b di 0dni    ;L
  959.  
  960. ; W 0dHP)
  961. Lncy th10
  962.  
  963. ; corn 0d        ;10
  964. 44 = A ifati_2 = AatvecON INTO
  965. SCend_eba = AL = 
  966.     mov dansib = AN_10
  967. ;
  968.     mHor vectl cH 1.10
  969. NG H.218h÷H: P10
  970. 10
  971. @    RO
  972. ;
  973. ;    WRITE_TT th10
  974. 10
  975. ndo thH        10
  976. return g
  977.  
  978. wni10
  979. 10
  980. 10
  981. 10
  982. _initTA th
  983. pc_the chry+:
  984.     callë_qk 10
  985. 10
  986. 10
  987. elaà pc_LL     D_
  988.  
  989. w10
  990. trn 2àOV    dX
  991.     pH,Aà= AItruesog b_exiCT 
  992.  
  993. w10
  994. endpingsoursh,alfsoBOC    AHte_c
  995.  
  996. w10
  997. 10
  998. 10
  999. 10
  1000. 10
  1001. 10
  1002. 10
  1003. ndoCH
  1004. 10
  1005. 10
  1006. 10
  1007. 10
  1008. 10
  1009. 10
  1010. 10
  1011. 10
  1012. t 1act
  1013.  
  1014. w10
  1015. 10
  1016. 10
  1017. 10
  1018. 10
  1019. 10
  1020. mm
  1021.  
  1022. w10
  1023.  
  1024.     DW    OFFnear
  1025.  
  1026. w10
  1027. v_k 10
  1028. 10
  1029. 10
  1030. endpttursc 
  1031.     mov
  1032.     j=  chCTSg b10
  1033. 10
  1034. 10
  1035. 10
  1036. 10
  1037. 10
  1038. 10
  1039. 10
  1040. 10
  1041. 10
  1042. ENOV    d10
  1043. 10
  1044. 10
  1045. 10
  1046. 10
  1047. 10
  1048. 10
  1049. 10
  1050. 10
  1051. 10
  1052. 10
  1053. 10
  1054. 10
  1055. RITttfct910
  1056. 10
  1057. 10
  1058. 10
  1059. 10
  1060. 10
  1061. 10
  1062. 10
  1063. HANGirettgot10
  1064. 10
  1065. 10
  1066. 10
  1067. 10
  1068. 10
  1069. 10
  1070. 10
  1071. 10
  1072. 10
  1073. DW    OFfct910
  1074. SI
  1075. E OOV    d10
  1076. COLSE O= it    k 10
  1077. 10
  1078. :        k 10
  1079. 10
  1080. wek OP    eg10
  1081. 10
  1082. 10
  1083. 10
  1084.   4ion,
  1085.  
  1086. w10
  1087. queâ
  1088.  
  1089. w10
  1090.     ofk 10
  1091. 10
  1092. 10
  1093. 10
  1094. 10
  1095. 10
  1096. 10
  1097. 10
  1098. OP    CH
  1099. col k 10
  1100. 10
  1101. 10
  1102.  ax,POP    gotS
  1103.     Mk lineeg,ast.SHL pc_T REk 10
  1104. 10
  1105. bx,k 10
  1106. 10
  1107. 10
  1108. ax    
  1109.  
  1110. w10
  1111. 10
  1112.  
  1113. w10
  1114. IN_k 10
  1115. 10
  1116. R
  1117.     Pk KIursR
  1118.     k 10
  1119. 10
  1120. LTk 10
  1121. 10
  1122. 10
  1123. 10
  1124. _ve pc_10
  1125. wax
  1126.  
  1127.  
  1128. w10
  1129. 10
  1130. 10
  1131. _vefct9lk 10
  1132. 10
  1133. 10
  1134. ; sa_vi_210
  1135. 10
  1136. _vegote =∙
  1137.  
  1138. wOV    des
  1139.     popk 10
  1140. 10
  1141. PORH,DING oS:pk ,rOV    dTE Csi
  1142.     pemul= ARIk  INTOg bLOW_Rk 10
  1143. 10
  1144. 10
  1145. HP fINGurs10
  1146. iteINGBOs     VECING0h
  1147. dG    Ae
  1148. ;    
  1149.  
  1150. w10
  1151. 10
  1152. 1
  1153.  
  1154.  
  1155. w10
  1156. ROWS Tk @fct9:on
  1157.  
  1158. wCH
  1159. 10
  1160. re 
  1161.     l_2h,81, DH
  1162.  
  1163. w10
  1164. _murn
  1165.  
  1166. weg10
  1167. 10
  1168. 10
  1169. 10
  1170. 10
  1171. 10
  1172. 10
  1173. 10
  1174. 10
  1175. 0h
  1176. _v10
  1177. 10
  1178.  INTOàcode10
  1179. 10
  1180. 10
  1181. 10
  1182. 10
  1183. 10
  1184. 10
  1185. 10
  1186. th · if:        10
  1187. ndp_v10
  1188. 10
  1189. IDEO ifLOW_R╝ theg = dCALL:P_    popX
  1190.     p10
  1191. 10
  1192. 10
  1193. 10
  1194. 10
  1195. 10
  1196. 10
  1197. 10
  1198. men_vi_v10
  1199. DO_FI
  1200.     legpt10
  1201. got10h10hvideP_10
  1202. 10
  1203. _3P_ndougendp
  1204.  PI
  1205.     JM:        ING AUND10hvectst(0
  1206.     JM_exiX
  1207.     pP_elayOS vll
  1208.     i_v10
  1209. h    l
  1210.     JMgc P_EN_exi = roP_10
  1211. 10
  1212. OS vAR_v10
  1213. 10
  1214.  MOVI_v10
  1215. LL_    ; tr
  1216. ug10
  1217. 10
  1218. EN_FITRIP_10
  1219. 10
  1220. ds
  1221.     I_v10
  1222. p
  1223.     P_10
  1224. 10
  1225.  60 dx,_v10
  1226. andP_D 6h
  1227. ;10
  1228. 10
  1229. 10
  1230. 10
  1231. e theP_D _exicode INCahOS v10
  1232. 10
  1233. D :              ;I
  1234.     p_v10
  1235.     CL
  1236.     dwahpt10
  1237. 10
  1238. DW    OF_exi10
  1239. OWOP6h
  1240. ;10
  1241. 10
  1242. DW    OFg10
  1243. 10
  1244. lineg10
  1245. 10
  1246. DW    OF_FI10
  1247. 10
  1248. DW    OFptTING ES 10h ext_PAES 6h
  1249. ;
  1250.     push    j_v10
  1251. #
  1252. pcES ALLcol w_ES vectolumno
  1253. _v10
  1254. ugJ,ahOS vER TP_10
  1255. 10
  1256. ;SEPTS,ahptv c LI,ahLOW_R
  1257.     MOP_KIcode10
  1258. 10
  1259. KIX
  1260.     pER R        ; readug10
  1261. ISC_v10
  1262. L_dP_KI_FIET_CP_KIptR
  1263.     POFFSE_v10
  1264. ;
  1265. ;s
  1266. ;
  1267.  
  1268.     jmp    r6h
  1269. ;READ_CP__ve
  1270. PUSD OLer ALL10
  1271. E AT_v10
  1272. 21 tendeer _exi_FIn ker OS vCX        ;ber :        L_DH_er g10
  1273. 10
  1274. 10
  1275. 10
  1276. STP_10
  1277. 10
  1278. DLP_10
  1279. 10
  1280. _isK PIcode
  1281.     Xl_q PIuged t_v10
  1282. 10
  1283. 10
  1284. @10h10
  1285. 10
  1286. 10
  1287. 10
  1288. v    IMEMEN6h
  1289. ;_mOSMEN
  1290. G    C1MENALLdx t.MENvect10
  1291. 10
  1292. 10
  1293. 10
  1294. pt= N_vOS vORP_10
  1295. :        ansi_ z_vg2
  1296.     N W_vLOW_R1
  1297. P_ ifad 10
  1298. 10
  1299. 10
  1300. 10
  1301. 10
  1302. fau(0delayax
  1303.     16(0ORT10
  1304. 10
  1305. 10
  1306. 10
  1307. 10
  1308. :[(0
  1309.     equenc
  1310.     POP    S10
  1311. 10
  1312. extend
  1313.     POP    S10
  1314. 10
  1315. nt sLoop10
  1316. T W
  1317.     POP    S10
  1318. 10
  1319. 10
  1320. 10
  1321.     poppciX
  1322.     PO
  1323.     POP    S10
  1324. 10
  1325. 10h    ; 12oop10
  1326. 10
  1327. 10
  1328. ndoNTE10
  1329. 10
  1330. 10
  1331. 10
  1332. endp
  1333.  aroop10
  1334. 10
  1335. 10
  1336. 10
  1337. 10
  1338. 10
  1339. 10
  1340. elay    ; 12s        ;oop10
  1341. reaosPORT
  1342.     DW    OFF
  1343.     POP    SelayxstOSEP
  1344.     etor
  1345. e
  1346.     JN
  1347.     JMì = B
  1348.     JNFSFFH
  1349.     POP    SEN10010
  1350. 10
  1351. ENOW
  1352.     :newritoopCOU k10
  1353. alseC e10
  1354. 10
  1355. alseAL,D10
  1356. 10
  1357. alseNTEk i    AL    li
  1358.     mo1hhiliend_ow c LO
  1359.     iad eAV
  1360.     i    ; 12        ;D
  1361.     POP    SD delayint10 =
  1362.     iORTPUSH    
  1363.     POP    SD xDI    
  1364.     POP    SD 
  1365.     eght ntrbuf 
  1366.     JM10
  1367. P  buf FS0_v'buf 100emen ofbuf OW
  1368.     si    ct_buf pci¢_Aoop10
  1369.  
  1370.  MSAL,DWIN
  1371.     POP    SOP    NTEATTRIB
  1372.     POP    SOP    
  1373.     moue E M MSend_ Nbl,1lad ct v_oop10
  1374.     Aall rldelayER TR [lORT10
  1375. is alx10
  1376. 10
  1377. 10
  1378. 10
  1379. 10
  1380. 10
  1381. 10
  1382. 10
  1383. 10
  1384. 10
  1385. 10
  1386. 10
  1387. 10
  1388. 10
  1389. @AL,D10
  1390. 10
  1391. 10
  1392. 10
  1393. 10
  1394. 10
  1395. 10
  1396. 10
  1397. 10
  1398. 10
  1399. 10
  1400. 10
  1401. 10
  1402. 10
  1403. 10
  1404. 10
  1405. 10
  1406. 10
  1407. 10
  1408. 10
  1409. 10
  1410. 10
  1411. 10
  1412. 10
  1413. 10
  1414. 10
  1415. 10
  1416. 10
  1417.  kDW    OF_ve╜10
  1418. 10
  1419. 10
  1420. 10
  1421. 10
  1422. 10
  1423. 10
  1424. 10
  1425.     ;LN
  1426.     _cuORT
  1427. L
  1428.     POP    S,rx
  1429. ; c
  1430.     POP    S10
  1431. 10
  1432. 10
  1433. 10
  1434. 10
  1435. 10
  1436. 10
  1437. 10
  1438. 10
  1439. 10
  1440. 10
  1441. 10
  1442. 10
  1443. 10
  1444. 10
  1445. 10
  1446. 10
  1447. 10
  1448. 10
  1449. 10
  1450. 10
  1451. 10
  1452. 10
  1453. 10
  1454. 10
  1455. 10
  1456. 10
  1457. 10
  1458. 10
  1459. 10
  1460. m:H
  1461.     Xoop10
  1462. 10
  1463.  
  1464.     mov poop10
  1465. ush    e
  1466.     POP    S@end_10
  1467. puoopad  es choop    ; 12
  1468. ;
  1469. ;    likoopdelay10
  1470. 10
  1471. 10
  1472. ORT_init
  1473.     POP    S10
  1474. 10
  1475. the chh
  1476.     doop10
  1477.   SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS0
  1478. 10
  1479. 10
  1480. ela┴
  1481. ;
  1482. D10
  1483. 7,┴ec COL
  1484. D O┴v iERMEM┴o i10
  1485. cle
  1486. FF_exiiiiiiiiipopLEendpret
  1487. e
  1488. ÿh,aO HP
  1489. (HC    AHURSOR
  1490. uph
  1491. mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmdodatrnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn0
  1492. 10
  1493. 10
  1494. ndpiniTI        dx,aycinifot 1    OFFos_10
  1495. ,0DI]iniz10
  1496. 10
  1497. elayr
  1498. _CURR    DSAR
  1499. ;
  1500. DAV drARec v_
  1501. aARv ic CTYARo i chURos_10
  1502. OS v
  1503. ;
  1504. eTELE
  1505. i
  1506.     rTEfo kDW    OFEN(Hc_rFOTEup  alH
  1507. HI_da theeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeelseTO B= ADDll_HI_ec  kDW    OFalsefods
  1508.     )
  1509. HI_1HANG_looHI_zhrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr r
  1510.  
  1511. pQctiv
  1512. ;
  1513. Dbl,aTE_Activec M
  1514. SINctivv iBMOWctivo i10
  1515. 6h    moFF:        scro    moLEweÄ    moÿ10
  1516. 10
  1517. DW    OF(H10
  1518.  
  1519. ;
  1520. ; rDOWupqueeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeP    da    ofA         ; tTO Bdh,os_10
  1521. 10
  1522. ET A    ; tfoby def    ; t1theblos_10
  1523. S
  1524.     Mree_CUr
  1525. 10
  1526.  
  1527. ;
  1528. be_CU
  1529. ;
  1530. DT REEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE0
  1531. 10
  1532. 10
  1533. KH_CUv iD    
  1534. _CUo i- ueUNDFFgl,0UNDLEteeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0
  1535. 10
  1536. ▀ BUND(H10
  1537. 10
  1538. 10
  1539. 10
  1540. 10
  1541. 10
  1542. }ON10
  1543. 10
  1544. 10
  1545. 10
  1546. 10
  1547. 10
  1548. 10
  1549.  /olumn ds UMN 4ugn AUMN
  1550.     rDL =
  1551. ;
  1552. tlinedeo;SEetUMNntryor a
  1553. ;
  1554. tlineDO_F
  1555.     MO
  1556. ;
  1557. tKI lBYds
  1558.     enablen stER RevenableIRATTRIB
  1559. ;
  1560. tKIDDL_d Fenable   10
  1561. curspoenablendpR
  1562.     Pif ndx,w 0;
  1563. ;
  1564. ;
  1565. t}curren    R10
  1566. ╕√ lo10
  1567. _FIILNSCR_
  1568.     r10
  1569. h        ;ush c10
  1570. 10
  1571. si NSCR_ntry10
  1572. hancNSCR_DO_FX
  1573.     POlliush c10
  1574. DLHANGush c10
  1575. 10
  1576. 2hush c10
  1577. s         re,CHDDe
  1578. ;
  1579. t INTO   10
  1580. 0
  1581. r,CHndp, CHotush c10
  1582. v    ADC0 ISW    ues 
  1583. ;
  1584. t@ e_G    C    gush c e_dx fe0 I
  1585.     popc
  1586.  
  1587. ;
  1588. t10
  1589.  4ptWush c
  1590.     rORCURREush cdeo10
  1591. 10
  1592. 10
  1593. ntry2
  1594.     _int10ush cDO_F10
  1595. 10
  1596. 10
  1597. 10
  1598. 10
  1599. _m devallTTYYYYcSDO10
  1600. ax
  1601.     
  1602. s10
  1603. 10
  1604. t        
  1605.     M devrH
  1606.     SSOR devADquencöSDO10
  1607. extend_VIDRct ant s╧SDO10
  1608. T WurnDRCROLLI
  1609.     PUSH OFFSETSDO10
  1610. ON10
  1611. 10
  1612. 10
  1613. 10
  1614. 10
  1615. 10
  1616. 10
  1617.     DX SDO10
  1618. 10
  1619. P1_3BU10
  1620.  
  1621.     dSDO10
  1622. "l
  1623. s10
  1624. 10
  1625. E IN INCr10
  1626. rit INCADDRreale    w INCs s
  1627.     DW    OFFv    aSDO10
  1628.  ch
  1629. s10
  1630. 10
  1631. 10
  1632. IBSDO10
  1633. ì3TINct a10
  1634.  andTINNO10
  1635.  /10
  1636. 10
  1637. 10
  1638. 10
  1639. 10
  1640. SUB    5 ndedYPE
  1641. s}k i_ac5 BU1hcl5 pub10
  1642. DXRT CBle
  1643. s}drSDO10
  1644. 10
  1645.  /DI    
  1646. sDW    OF        ; cght s.OREahINTNS    NSDO10
  1647. 10
  1648. 10
  1649. DW    OFNO10
  1650. >ORECROLLI10
  1651. 10
  1652. DW    OFY H10
  1653.  0I
  1654.     pBU lo10
  1655. 10
  1656.  
  1657.     DW    OFFSE    SC        ; cCres    SCBUue PASSDO10
  1658.  N
  1659.     pop    I
  1660.     pBlct M
  1661. I
  1662.     pall10
  1663. 10
  1664. lineADDR10
  1665. 10
  1666. lines s_FI
  1667. s} lo10
  1668. off╤ mect a10
  1669. 10
  1670. 10
  1671. 10
  1672. 10
  1673. 10
  1674. KICROLLI10
  1675. 10
  1676. }10
  1677.  / lo10
  1678. 10
  1679. wax
  1680. SDO10
  1681. 10
  1682. 10
  1683. _vepub10
  1684. rc
  1685.     dwBl10
  1686. 10
  1687. 10
  1688. 10
  1689.  1
  1690.     dwADDR    ;LN SDO10
  1691. TE CAT        ; c
  1692. ; csab
  1693.     dwADSTDI    SDO10
  1694. ati
  1695. s INTOct avecUNCTATNO10
  1696. 10
  1697. 10
  1698. 10
  1699.  
  1700.     mov d
  1701. s INTOY H10
  1702.  /ON@ndedm:
  1703. s10
  1704. 10
  1705. 10
  1706. e uSDO10
  1707. _qCH loBl es
  1708. s10
  1709. all
  1710. ;
  1711. ;    
  1712. s10
  1713. ADDR10
  1714.  /10
  1715. 10
  1716. 10
  1717. rthe ch[SDOAD10
  1718. 10
  1719. 10
  1720. 10
  1721.  lo10
  1722. LL     LL        ;ABRCOL
  1723. ena        ;APPERCOU}AI 0sp10
  1724. 1hCHFAERh,a, iO DnearC    AHCOU}10
  1725.  
  1726. ;sp10
  1727. ONndocl
  1728. COUelayOP_CURRdel
  1729.     mX
  1730.     10
  1731. ng A
  1732.     mBRv_COU10
  1733. 10
  1734. 10
  1735.  /;
  1736.     domar
  1737. 10
  1738. 10
  1739. 10
  1740. 10
  1741. 10
  1742. SEGdomnearc_rt csp10
  1743. 10
  1744. 10
  1745. 10
  1746. 10
  1747.  theCOU}10
  1748. 10
  1749. alsec    d10
  1750. 10
  1751. D         ;COds
  1752.     COUalse        ;COHANGILLsp10
  1753. hrQU
  1754.     pusOP
  1755. pbx
  1756.     pusX
  1757.     10
  1758. 10
  1759. D BRM
  1760. COU}10
  1761.  
  1762.     pop    dsp10
  1763. 10
  1764. 6h
  1765.     m.
  1766. ;:        COU}10
  1767.  
  1768.     DW    OFFSE
  1769.     mER WICOU10
  1770. 10
  1771.   4ump
  1772.     mall WINCHON10
  1773. 10
  1774. SHCOU10
  1775. 10
  1776. theh    ;mp s        ;CO10
  1777.  
  1778.     jmp    remp scl
  1779. S
  1780.     M IT0 HOP10
  1781.  
  1782. ;
  1783. be0 HX
  1784.     T RExtesp10
  1785. 10
  1786. KHsp10
  1787. DCOUlineERRO10
  1788. O sp10
  1789. 10
  1790. 10
  1791. KIar
  1792. ATTRIBCOU}mptS L = cnearC_2MP  L = call ead_1
  1793. ;
  1794.     PU    offseLT  4
  1795.     PUVIDEO10
  1796. 10
  1797. _vec    d0COU_veall IF OFFS sa10
  1798.  /CgetsX
  1799.     POR^getsBRS:pCOU,rPP10
  1800.  /e thei,10
  1801. 10
  1802. OF i,10
  1803. 10
  1804. 10
  1805. ,D    jE
  1806. Wpos;    BRN10
  1807. 10
  1808. 10
  1809. 10
  1810. 10
  1811. quenON}10
  1812. 10
  1813. 10
  1814. 10
  1815. 10
  1816. SUB    W    O10
  1817. YPE.7W    O10
  1818.     AHCALL    F} = a.
  1819. bnt    mptDH.
  1820. bbelllARA.
  1821. b
  1822. ;
  1823. ptinrow_t.
  1824. bOP    AWRITE_A,cse10
  1825. e =ERTse10
  1826. es
  1827.     popPOG     DPORffhse10
  1828. S:pE:G    SI,TE CulatG    etnARIuch INTOAND LOW_Rs_SH C╚CHARAReSH CRIB10
  1829. itese10
  1830. s     ,se10
  1831. 10
  1832. msorts r_ead_se10
  1833. ROWS Tinitortbell:ble_pcort
  1834. ;
  1835. pTTR uch@OP    Ah,81uch@dx,c10
  1836.     popse10
  1837. int    1 CHAse10
  1838. 5
  1839. uch10
  1840. CH,Cs ofuch10
  1841. SI,T Spop    se10
  1842. ndo      bq_    b = d_inq_    OFFth         ; co10
  1843. 10
  1844. Bh H = N10
  1845.  = arneq_e_fals10
  1846. oinOFFSEDSCALL:        ; co    pop0h         HAse H = N10
  1847. dxXCHOFFSEB                                                                                                             en        ;SOFFSERY DO_FI        ; co    pop
  1848. ;      dOV    dendp
  1849.  
  1850.     jmp    rvidev iH = N10
  1851. _3PPendp
  1852. b        OFFSE        ; co10
  1853. 10
  1854. 10
  1855. 10
  1856. 10
  1857. 10
  1858. 10
  1859. ; 15op    b10
  1860. 10
  1861. 10
  1862. 10
  1863. ll        ; co10
  1864. 10
  1865. 10
  1866. hanH = N10
  1867. 10
  1868. 10
  1869. 10
  1870. 10
  1871.  = ro the H = N10
  1872. eqmpts
  1873. ;
  1874. 0h        10
  1875.  /FILLdl10
  1876.  /C e:
  1877.     call lo10
  1878. 10
  1879.  /10
  1880. 10
  1881. 10
  1882. 10
  1883. 10
  1884. 10
  1885.  INTODSDLWRITE_ASH D0h        _iscurreSH DC    C
  1886.     Xic H = N10
  1887. eX,SH DRY u,0fSH D
  1888. ;, CH        ; co@
  1889.     jmp    rv    RDSUBRTues         ; co10
  1890. 10
  1891. G    CH = #SUBR
  1892.     jldx disablSUBRdl10
  1893. }H = N    bptst H = N    OFF10
  1894. 10
  1895. 10
  1896. 10
  1897. ansi_nH = Nme10
  1898. 10
  1899. 10
  1900. e_fals1
  1901.  
  1902.     PT 10
  1903. _qe =T 10
  1904. TTYthT 10
  1905. ax
  1906.     leatendeNO E10
  1907. 10
  1908. 10
  1909. 10
  1910. 10
  1911. 10
  1912. 10
  1913. 10
  1914. 10
  1915. 10
  1916. 10
  1917. 10
  1918. extendmi curr10
  1919. 10
  1920. 10
  1921. 10
  1922. 10
  1923. 10
  1924.     popn of 
  1925.     PUSH wr T  X
  1926.     PO
  1927. pc_ING Ales10
  1928. 10
  1929. ndoIDE10
  1930. 10
  1931. 10
  1932. 10
  1933. 10
  1934. 10
  1935. 10
  1936. 10
  1937. endp
  1938. D AT10
  1939. 10
  1940. 10
  1941. 10
  1942. 10
  1943. 10
  1944. 10
  1945. 10
  1946. 10
  1947. 10
  1948.  ah,7T 10
  1949. 10
  1950. z tT 10
  1951. 10
  1952. 10
  1953. elayσ10
  1954. 10
  1955. 10
  1956. 10
  1957. 10
  1958. IBMP Ier 10
  1959. 10
  1960. EN    E10
  1961. e.T 10
  1962. 10
  1963. 10
  1964. 10
  1965. 10
  1966. 10
  1967. 10
  1968. ENT  int10ROMT 10
  1969. 6h
  1970. ;[diT 10
  1971. YPED AT10
  1972. 10
  1973. 10
  1974. hT 10
  1975. 10
  1976. ear        ;b
  1977.     dow ccont        ;bE IeD AT10
  1978. 10
  1979.         ;D2        ;b    E10
  1980. 10
  1981. 10
  1982. 10
  1983. PUSH    h
  1984. ;        ;bσDI    WRITE_CT 10
  1985. :        equeT 10
  1986. INTD ATKI PI0_vconCROLL
  1987. ;10
  1988. >CROLLn of si            ; iCROLLT  ¢pT 10
  1989.  
  1990. ng b
  1991.  
  1992. ; IDEWINwax
  1993.  
  1994. ; proC    equT 10
  1995. ue fh,
  1996.  
  1997. ; ON  Nte iH_E Ict S:pT 10
  1998.     A colH_    EER TTTlH_NO ExoD ATlineσit:LEFTH_
  1999.     dv c
  2000.     push    .
  2001. ;er offR T 10
  2002. IN_3.
  2003. ;
  2004. ; RETREN.
  2005. ;n of 10
  2006. read_a.
  2007. ;T  h eenable_V,lesALL    dxV,IDEyboD AT_vepro000
  2008.     OV,h
  2009.     x10 es:T 10
  2010. 0NV├E IingsTE C├ arbx,bno ├    E10
  2011.     DI├NO E
  2012. L
  2013. ;
  2014.     pu├σ
  2015. ; c¡├
  2016.     dSTD AT INTOer atiUB    E PcurrvecMOVE P
  2017. ;end_eH,bE Pn of 10
  2018. ROUE PT      AHAX,_3:lesvectD AT@IDEm::
  2019.     call    _3:pro18h0 f_3:h
  2020.     xush    eD AT@ON 
  2021. ;
  2022. dROW T E I10
  2023. ndoT  ar
  2024. ;
  2025. ;    _SCT     EOWp
  2026. T NO E_init ORT 10
  2027. the chcomT 
  2028.     d  SHz} PIE INALL    OR    DDD0
  2029. LL     rOR    Dbeep10
  2030. _cnOR    Dct tER_fct_FI10
  2031. AImaxem: _exi«emnf10
  2032. doem
  2033.     Oh,aOW    em    axC    AHpoemmov h
  2034. mHzndoIF trnLOW_R,0 = rowiniDO_F,0 H10
  2035. T O,0write_ct 1e_fals,0nu,029,0
  2036. ;    10
  2037. mmOR TY PI_CURR"[OR TYYY0
  2038. AV0hOR TYbeepv_Hzelayct tc ablOR TY    ;R chNEX,bx: OS vHzENnf
  2039. iCSFI10
  2040. A     Θ,bx    axc_rseq,bxmov   alHIGH_RFI10
  2041.  theCHARAK = row= ADDsaveFI10
  2042. W   ar Kwrite_cds
  2043.     dinKnuHANGwrite_c_K
  2044. ;    10
  2045. es:[kb_ PI
  2046. psekb___0
  2047. bl,a:
  2048.     cakb_beep10
  2049. SI
  2050. kb_ct tBMLOWkb_    ;Rit        ;ABINI: :        HzDW    OFnfweILL:INI
  2051.     O WI
  2052. IINI    ax10
  2053.     pop    sINImov quecalll_qIF     ofRIl_q = row10
  2054. ╖l_q HSH ANDl_qwrite_cby T COl_qnu10
  2055. DW    OF10
  2056. COUS
  2057.     M_DOT al,d PI,asaval,ddd0
  2058. T REHz10
  2059. 10
  2060. 10
  2061. KHFI10
  2062. 10
  2063.  mFI10
  2064. 10
  2065. 10
  2066. 10
  2067. 10
  2068. 10
  2069. 10
  2070. 10
  2071. 10
  2072. 10
  2073. 10
  2074. 10
  2075. 10
  2076. 10
  2077. 10
  2078. KI    ax10
  2079. 10
  2080. KImov 10
  2081. DUd tIF LTHz_vemov mptT  ;d t Hlariad twrite_ctin400d tnu10
  2082. m eFI10
  2083. e =
  2084.     mov dFI10
  2085. 10
  2086.     DIFICOU kw 0FI10
  2087. S:pUBFI10
  2088. atid Iê    ;RARI fFI10
  2089. LOW_RHz INTOnfCHARAar
  2090. FI10
  2091. RIG    ACOD    axs     cyCODmov G    AHz@IF r_Hz10
  2092. IF ROWS Th
  2093.     dwUL H: ,FI10
  2094. TTR usedULnuh,81Hz@
  2095. ;    10
  2096.     popFI PIint    10_VFIII0
  2097. 10
  2098. DW    OFFIbeep10
  2099. KIFI10
  2100. T Sll (FI10
  2101. ndoHz}COLOR10
  2102. 10
  2103. }DI]th 
  2104.     MOV    Bto ²    O = at w²2910
  2105. oin 0
  2106.     D;CCALL:r_ 0
  2107.     Deci HAfor f    pop
  2108. ;
  2109. ; dx6h
  2110.  0
  2111.     Doutmen90:
  2112.     pop10
  2113. DO_FI∞ 0
  2114.     Dorm      d= "lMENvideo i"lmov I10
  2115. cl
  2116. "luc    OFFSEfor fndoº,0for fndoorm10
  2117. ; 15
  2118.     pop10
  2119. X
  2120.     pfor f10
  2121. 10
  2122. llfor felay
  2123.     MOV    h    for f10
  2124. 10
  2125. torrm tou29 = rofor f10
  2126. 10
  2127. eqfor f10
  2128. 10
  2129. 10
  2130. 10
  2131. 10
  2132. 10
  2133. 10
  2134.  
  2135.     CALIMEoutof rolu
  2136.     pop10
  2137. 10
  2138. 10
  2139. 10
  2140. 10
  2141. E HAL
  2142.     pop10
  2143. 10
  2144. IS t    ;mov I 60 d *t    ;ucandfor falseº10
  2145. ebt    ;h
  2146. c10
  2147. 10
  2148. D MEN10
  2149. dpIMDI]10
  2150. = H
  2151.     pop10
  2152. 10
  2153. T RIM    O    CL
  2154.     MOV
  2155.     pop10
  2156. 10
  2157. 10
  2158. 10
  2159. 10
  2160. OF :
  2161.     pop10
  2162. wefor fDW    OFuc10
  2163. 10
  2164. EN_v avfor fDW    OFt MrandendeOSormTINGfor f10
  2165. 10
  2166. 10
  2167. ±elmov I
  2168.     pushACKeluc10
  2169. 10
  2170. 10
  2171. 10
  2172. thefor fOP    orm10
  2173. s of
  2174.     pop10
  2175. 10
  2176. RN
  2177. ;
  2178. bDI]DL =for fline
  2179.     MOV    10
  2180. 10
  2181. line    O10
  2182. ll)
  2183.     pop10
  2184. 10
  2185. 10
  2186. KIMENBYfor fKIDI]10
  2187. cou1
  2188. ;
  2189. ; 10
  2190. ISC1out10
  2191. ble_p1t MET_Ca 1ormR
  2192.     Pfor f10
  2193. 10
  2194. 10
  2195. 10
  2196. 10
  2197. 10
  2198. READ_C ah
  2199.     pop10
  2200. 21 psmsdº    J= ADmsdh
  2201. c10
  2202. EL    POCOLORPORfor f,rDI]10
  2203. 10
  2204. 10
  2205. 10
  2206. 10
  2207. si 
  2208.     pop10
  2209. 10
  2210. hanc    PO29rando,At.;C10
  2211. the cht.eci_is
  2212.     PUSt.
  2213. ;
  2214. ; 10
  2215. OR    DHt.outefun
  2216.     pop10
  2217. uus
  2218.     pop10
  2219. ues y
  2220.     pop10
  2221. v    buf_c nmov I10
  2222. ,C
  2223.     pop10
  2224. 10
  2225. 10
  2226. @ºdx IA
  2227.     pop10
  2228. 10
  2229. }
  2230.     popCOLORptoffse
  2231.     popDI]10
  2232. 10
  2233. 10
  2234.  
  2235.     MOV    ansi_r
  2236.     
  2237.     pop    O2
  2238.     JMP
  2239.     pop10
  2240.   S10
  2241.  
  2242.     pop10
  2243. _qreturn gdeo_
  2244.     cmp10
  2245. 10
  2246. ,rble:ax
  2247.     10
  2248. }hic10
  2249. 10
  2250. 10
  2251. 10
  2252. H
  2253.     S:[P_10
  2254. 10
  2255. 10
  2256.     pop_vextend0h
  2257.  calquen10
  2258. 10
  2259.     pop    ;A10
  2260. 10
  2261. ndo
  2262.     cmp
  2263.     PUSH S     calT:    X
  2264.     PO        ;actitr10h10
  2265. ndo pro kDW    OFndo axlatio10
  2266. ndo extendendp
  2267.  
  2268.     dP_10
  2269. 10
  2270. rit= N    d─int    1= N
  2271.     cmp10
  2272. 10
  2273. 10
  2274. rea10
  2275. 10
  2276. 10
  2277. 10
  2278. 10
  2279. 10
  2280. 10
  2281. 10
  2282.     DX P_10
  2283. tor10
  2284. EN
  2285.     cmp10
  2286. 10
  2287. 10
  2288. 10
  2289. FFH10
  2290. 10
  2291. 10
  2292. 10
  2293. 10
  2294. 10
  2295. 10
  2296. 10
  2297. e.csT:    z 10
  2298. alsetr6h
  2299. ;SUB        alr o10
  2300. AH P_10
  2301. 10
  2302. 10
  2303. DW    OFT:    10
  2304. 10
  2305. alseal,0ow c10
  2306. 10
  2307. 10
  2308. 10
  2309. 10
  2310. 10
  2311. 10
  2312. 10
  2313. 10
  2314. D  pro10
  2315. 10
  2316. 10
  2317. 10
  2318. 10
  2319. 10
  2320. 10
  2321. 10
  2322. 10
  2323. 10
  2324. 10
  2325. 10
  2326. 10
  2327. 10
  2328. 10
  2329. 10
  2330. INT10
  2331. DW    OFROLL0_vAHASC    ;Aeme>ASCk10
  2332. 10
  2333. OP        d¢
  2334. ;
  2335. ; r    ;tr10
  2336. 10
  2337. OP    r oWIN
  2338.     DW    OFFSE    ; ax10
  2339. RO    ; extendue of    ;T:    10
  2340. DE'P_10
  2341. ct s of zr o10
  2342. T IS z proER Tis aP_10
  2343. 10
  2344. 10
  2345. lineROLL10
  2346.  
  2347.     cm zinitiv cax    alquenoff10
  2348. 10
  2349. 10
  2350. IN_TION P_10
  2351.  RETendpalk10
  2352. read_aalT:    10
  2353. 10
  2354. _ve axALL10
  2355. _ver o10
  2356. 10
  2357. 10
  2358. 10
  2359. 10
  2360. wax
  2361. P_10
  2362. TE C?
  2363.     lal,00rcN Wtr10
  2364.      ;BP_10
  2365. 10
  2366. 10
  2367. ,r pro    ;L    DIN Whic
  2368. L10
  2369. 10
  2370. 10
  2371. 10
  2372. E PT= NCT10
  2373. 44P_10
  2374. OR85P_10
  2375. vec10
  2376. 10
  2377. 10
  2378. 10
  2379. 10
  2380.  INTOk
  2381.     mov dROUⁿT:        AH;
  2382.     mdi,trvect byP_10
  2383. m:NG di, ax18hre P_COU ke udi,al,010
  2384. puP_    d esndoP_
  2385.     cmp
  2386. ;
  2387. ;    10
  2388. 10
  2389. 10
  2390. OWten
  2391.     CMhic_init_veP_ROLLthe ch@P_initi# FA
  2392.     CM10
  2393.  
  2394.     iT N
  2395.     DE00; pe r
  2396.     DEsitrib                  CM10
  2397. CT ON10
  2398. 10
  2399. soleROW
  2400.     CM10
  2401. C eON    popL    d_coLOW INT1  2olV_AINT1cnreadON10
  2402. 10
  2403. A Squ  ≥
  2404.     j = d
  2405.     CM10
  2406. ARONndo
  2407.     dw    
  2408.     mata,
  2409.     CM10
  2410. 10
  2411.  
  2412. ;
  2413.     CM10
  2414. OR TYON10
  2415. 10
  2416.  HEONelay(0MP    BON10
  2417. 10
  2418. 10
  2419. 10
  2420. elaysitM B
  2421.     CM10
  2422. 10
  2423.     DX 
  2424.     CM10
  2425. 10
  2426. 10
  2427. 10
  2428. COU kz t
  2429.     CM10
  2430. 10
  2431. 10
  2432. 10
  2433. 10
  2434. E
  2435.     c fnccnesCL=ncPUT10
  2436. SUB+2≥; 83th +2ons╠vid
  2437.     CM10
  2438. ng tSET W+2OV    b
  2439.     DW    ld+216hFASONalse; 1510
  2440. 10
  2441. 10
  2442. 10
  2443. _P80set 00;dw 0ON10
  2444. 10
  2445. FUNd_c
  2446.     CM10
  2447. 10
  2448. COLSset # OF t fts
  2449.     cald_d10
  2450. :
  2451.     mov
  2452.     calL    d)
  2453.     ON10
  2454. 10
  2455. nerONDW    OFcn]    ON10
  2456. 10
  2457.  
  2458. ;
  2459.     ar a16≥s oscree
  2460.     CM10
  2461. 10
  2462. 10
  2463. OP    sitING UONOP    OV    b ou;RI1616h10
  2464.  ax,16; 15      ONline(0solONline00;    ds
  2465. AL
  2466.     CM10
  2467. 10
  2468. 10
  2469. 10
  2470. 10
  2471. ]ONline# OF LL rn  0fd_dommoMO
  2472.     CM10
  2473. LEFT ON10
  2474. 10
  2475. nt ese 
  2476.     CM10
  2477.     dx
  2478. ONKIPUT  Cp
  2479. ;ro≥    S = aroonsWIw vro
  2480.     dw    ¿ON_veOV    bTA pctro16hpc_bliro; 1510
  2481. 10
  2482. 10
  2483. 10
  2484. 10
  2485. 10
  2486. ,r00;W TON10
  2487. 10
  2488. 10
  2489. gonCTct,In# OF     ; gON INTOd_dvedON INTOL    d10
  2490. SEGon e10
  2491. DSba
  2492.     CM10
  2493. HLsh    
  2494.     CM10
  2495. REM_t:
  2496.     m≥int 1ON10
  2497. 10
  2498. 10
  2499. 10
  2500. 10
  2501. 10
  2502.  
  2503. ;
  2504. bON10
  2505. 10
  2506. ,BSTC
  2507.     CM10
  2508. 84
  2509.  
  2510. ; W:
  2511.     m; 1510
  2512.     pop
  2513.     CM(0al_ency
  2514.     CM00;10
  2515. DW    OF
  2516.     CMOV    b10
  2517. KI
  2518.     CM10
  2519. 10
  2520. 10
  2521. 10
  2522. # OF elayON}≈10
  2523. d inty9TIODon e10
  2524. 10
  2525. LOWEtyh d to TERtyW_R10
  2526.  
  2527.     e 60ent:CT CALL: 60B10
  2528.  en 60fct:axy: 60AlV        AL,on e10
  2529. ds
  2530.     equ  60mm SUBRg b─ä10
  2531. 10
  2532. ndobee INCk ndoALL    RJAND on e10
  2533. n kk ndo9= Nk 10
  2534. 10
  2535. 10
  2536. 10
  2537. 10
  2538. 10
  2539. SUProw,on e10
  2540. 10
  2541. hanon e10
  2542. 10
  2543. 10
  2544. EN910
  2545. ╢mov    ent:n:k ENB
  2546. ;
  2547. ePAGmov    fct:scroEon e10
  2548. 10
  2549. 10
  2550. EN, pO Hjg:neaent:10
  2551. 10
  2552. 10
  2553. 10
  2554. 10
  2555. IS on e10
  2556. 10
  2557. hon e10
  2558. FASk 10
  2559. 10
  2560. 10
  2561. 10
  2562. 10
  2563. 10
  2564. 10
  2565. 10
  2566. 10
  2567. 10
  2568. 10
  2569. 10
  2570. 10
  2571. 10
  2572. 10
  2573. 10
  2574. 10
  2575. 10
  2576. 10
  2577. 10
  2578. D h d    JMk D W_RUNCTsh bLent:ID_k 10
  2579. 10
  2580. 10
  2581. ,DLfct:10
  2582. 10
  2583. 10
  2584. 10
  2585. ah,113L, p= 8LOR Lmmp    wop
  2586. on e10
  2587. DATAp(atubeeh
  2588. wINCatuALL    R10
  2589.  
  2590. pciatu
  2591. ;
  2592.     , co; eatu9V    ARR21h
  2593. ≈10
  2594. 10
  2595. 10
  2596. 10
  2597. 10
  2598. 10
  2599. KImm proc ur 21h
  2600. h dr.ow,21h
  2601. W_Ru     AXuse ent:10
  2602. _inituse BREAD_ 6use fct:ommo
  2603.     PUuse Al10
  2604. ble_puse , ps_ORDon e10
  2605. EAD_infoon e10
  2606. 10
  2607. G    DAUbee10
  2608. fasAUALL    R    dwiveron e10
  2609. 10
  2610. E ATAU9st 1h
  2611. ≈xk ,rnd[diof lon e10
  2612. ng b    i1h
  2613. h d10
  2614. hanc1h
  2615. W_R10
  2616. 10
  2617.  INTOent:«DO_FIon e10
  2618. 10
  2619. 2hon e10
  2620. 10
  2621. 10
  2622. 10
  2623. 10
  2624. 10
  2625. 10
  2626. 10
  2627. 10
  2628. ta k  INTOmm10
  2629. 10
  2630. 10
  2631. 10
  2632. 10
  2633. b_r
  2634. cbeefct_CURon e10
  2635. esek 10
  2636. 10
  2637. ,Bk 10
  2638. 10
  2639. offsek 10
  2640. 10
  2641. 84UNCon endSUB    k 10
  2642. 10
  2643. ed fk 10
  2644. h d10
  2645. ,ron eW_R byk on e10
  2646. ≤      dH        _CURR;
  2647.     t_lpH        
  2648. p10
  2649. return gH        ,aMO.
  2650. ;    H        es
  2651.     popOR
  2652. HH        int    1    CAP_10
  2653. 10
  2654. 10
  2655. 10
  2656.     popp
  2657.     10
  2658. curso
  2659.     cmp10
  2660.  procUMë;
  2661. ;readINGëv    10
  2662.         ;X
  2663.     pextend
  2664.     JM
  2665.     JMX
  2666.     pì
  2667. ;
  2668. ; extP_10
  2669. 10
  2670. ffh P_ndooff10
  2671.  
  2672.     dX
  2673.     pati tou_v    ; 12E IN10
  2674. int    1    ; 12_CURRn 8li    ; 12
  2675. py_P_10
  2676. 10
  2677. C_cATTRI    ; 12v    10
  2678. 10
  2679. 10
  2680. 10
  2681. 10
  2682. 10
  2683. 10
  2684. 10
  2685. ve,eTE
  2686.     cmp10
  2687.  exteP_10
  2688. 10
  2689. ll dP_10
  2690. 10
  2691. ntP_ENv    IV√n stextendFS
  2692. ;
  2693. ; ext
  2694.     cmp10
  2695.  
  2696.     JSt.
  2697.     cmp10
  2698. r iUMNn stoff_HNSCR_
  2699.     cmp10
  2700. 10
  2701. DXallextend10
  2702. dpall_CURR posP_D 
  2703. p10
  2704. 10
  2705. D ,a10
  2706. 10
  2707. D es
  2708.     pop10
  2709. 10
  2710. D int    110
  2711.  
  2712.     DW    OFFSEVIDEOvideSCdomVIDEOp
  2713.     _PP_DW    OF ext,3L = cVIDEO;
  2714. ;10
  2715.  
  2716.     pop    sVIDEOv    
  2717.     D
  2718. W
  2719.     cmp10
  2720. 100P_OP    ì10
  2721. rd SI10
  2722. ; sev_■offdsP_lineINT reRNuptE INpe    OFFSEupt_CURR ou21hupt
  2723. p10
  2724. terupt,a10
  2725.  
  2726. ;
  2727. ; ruptes
  2728.     pop
  2729.  
  2730. extenduptint    1URRr lnt    vide
  2731.     jmerr
  2732.     cmp10
  2733. reset,Lnt     extay entry:nt    ;
  2734. ; 100SH C
  2735.     cmp10
  2736. o    q_0h        extendOW
  2737.     P__veì    ; cOFFS0h        INT  Ced 
  2738.     cmp10
  2739. A Ft    0h        ati    poH = N arE IN10
  2740. 10
  2741. ,r_CURR½P_,r
  2742. p10
  2743.     DI ar,ans V,
  2744.     cmp10
  2745. 10
  2746. 10
  2747. 10
  2748. 10
  2749.  
  2750. ;
  2751. em
  2752.     cmp10
  2753. OD,bx = rowp
  2754.     etnewINI
  2755.     cmp10
  2756. cx
  2757. b = row;
  2758. ; scCOD = rowv    10
  2759. 10
  2760. 10
  2761. 10
  2762. 10
  2763.  byeciì10
  2764. NG 
  2765.     cmp10
  2766.     ;#P_@off10
  2767. e ueciati
  2768.  P_10
  2769. E INrd acti
  2770.     cmp10
  2771. 10
  2772. 10
  2773. 10
  2774. 10
  2775. 10
  2776. 10
  2777. 10
  2778. ,al    c
  2779.     l
  2780.     cmp10
  2781. hardi,
  2782.     cmp10
  2783. 10
  2784. 10
  2785. 10
  2786. 10
  2787. 10
  2788. 10
  2789. 10
  2790. 10
  2791.  p
  2792.     calSI10
  2793. rib 0fonsal_10
  2794. exiSI10
  2795. 10
  2796. cleSI10
  2797. 10
  2798. 10
  2799.     popve,e_co
  2800.     POP    S10
  2801. 10
  2802. 10
  2803. ┤SI10
  2804. ell1h
  2805. BODA S
  2806.     POP    Sndo
  2807.     i
  2808.     jX
  2809.     p_CURROD10
  2810. 10
  2811. 10
  2812. 10
  2813. 10
  2814. 10
  2815. 10
  2816. 10
  2817. 10
  2818. 10
  2819. ndoME10
  2820. 10
  2821. 10
  2822. 10
  2823. 10
  2824. 10
  2825. 10
  2826. 10
  2827. 10
  2828. 10
  2829. elayZ    NmnMOVMP    BDATA10
  2830. ERRUSI10
  2831. DL
  2832.     POP    S10
  2833. 10
  2834. AX
  2835.     POP    SENactAL,Dn 8[Dve,e_ROW    us_[DSCE
  2836.     
  2837.     POP    SENEAD10
  2838. l_[DODy_l
  2839.     POP    S10
  2840. 10
  2841. ; 83lls        ;MP    B╠
  2842.     POP    S10
  2843. 10
  2844. 10
  2845. 10
  2846. alsesol
  2847.     DW    ar es        ;MEFASdisabs        ;al_offs
  2848.     POP    SD PBH    
  2849.     POP    SOP    
  2850.     podw 0
  2851.     POP    SD DATAFUN
  2852. exSI10
  2853. UNCT:
  2854.     cSI10
  2855. t f MOVZ    N10
  2856. :
  2857.     movSI10
  2858. 10
  2859. 10
  2860. DW    OFSCner
  2861.     POP    SDW    OF
  2862.     jm]    waMOVOD
  2863. ;
  2864.     a
  2865.     POP    S10
  2866. 10
  2867. s oenSI10
  2868. buf    
  2869. ;
  2870. ; ESI10
  2871. ING UIOSI10
  2872. 10
  2873. ME osME10
  2874.  ax,osal_10
  2875. 10
  2876. linePsolall rSI10
  2877.     ds
  2878.  
  2879.     POP    S10
  2880. 10
  2881. avi;
  2882. ; SI10
  2883. 10
  2884. 10
  2885. lineble:10
  2886. ax    SI10
  2887.  
  2888.     moC_cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccve,e10
  2889. 10
  2890. KIDATA10
  2891. endpSI10
  2892. 10
  2893. |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||al__lp
  2894.     POP    S10
  2895. 10
  2896. ¿ ;INMP    BWI
  2897. pctINBH    10
  2898.  
  2899.     jmp    reINsolTA 
  2900.     POP    S_veME10
  2901. 10
  2902. _veal_d pt
  2903.     PUS
  2904.     pP10
  2905. 10
  2906. ,rZ    NW T RESI10
  2907.  
  2908.     mov    bSCRSI10
  2909. 10
  2910. 10
  2911. ,ral_10
  2912. 10
  2913. 10
  2914. 10
  2915. 10
  2916. har keve,eirve    SI10
  2917. DSSS0 ke
  2918.     jmREMpop  keOD10
  2919. 10
  2920. @
  2921.     iint 1 = roSI10
  2922.  
  2923.     jmbl OSEBH    
  2924. ;
  2925. b
  2926.     POP    S@sol2f        OSEMErite
  2927.     POP    S10
  2928. 10
  2929. ed f
  2930.     POP    S10
  2931. 10
  2932. 10
  2933. 10
  2934. 10
  2935. 10
  2936. 10
  2937. 10
  2938. 10
  2939. 10
  2940. 10
  2941. KISI10
  2942. 10
  2943.  INTOSIble:elay
  2944.     DEwrit10
  2945. 10
  2946. 10
  2947. }    DSTIO
  2948.     DW
  2949.     C P10
  2950. 10
  2951. }BX10
  2952. 10
  2953. }"[10
  2954. e~10
  2955. 10
  2956.     pop[DI
  2957. ser l
  2958. eTHEaxRETURwrit10
  2959. 10
  2960.  gwrit10
  2961. ds
  2962. P
  2963. ee s SUBRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRdo
  2964.     JN10
  2965. 10
  2966. 10
  2967. 10
  2968.  INCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0
  2969. 10
  2970. JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ0
  2971. 10
  2972. 10
  2973.  
  2974. ;    writ10
  2975.  
  2976. ;  SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSlaynear    ; 12ve,ewrit10
  2977. SUP ton 8dellayBXFILeon 8"[10
  2978. 10
  2979. 10
  2980. 10
  2981. 10
  2982. z twrit10
  2983. _ROW                                                                                                                                                                                                                                                                                    NTHE10
  2984. OR = Bs pl,0re 0 = Bit:10
  2985. FSE = Be sMORx
  2986. ;writ10
  2987. G CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC0
  2988. 10
  2989. 10
  2990.  
  2991.     POwrit10
  2992. n Ax
  2993.     writ10
  2994. ILLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLlseddelaywriteus_near10
  2995. 84us_THER
  2996.  
  2997.  
  2998.  
  2999.  
  3000.  
  3001.  
  3002.  
  3003.  
  3004.  
  3005.  
  3006.  
  3007.  
  3008.  
  3009.  
  3010.  
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026.  
  3027.  
  3028.  
  3029.  
  3030.  
  3031.  
  3032.  
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040.  
  3041.  
  3042.  
  3043.  
  3044. 0
  3045. 10
  3046. 10
  3047. 10
  3048. D BX10
  3049. 10
  3050. 10
  3051. 10
  3052. UNCT_frnt:~10
  3053. OWnt:[DDE:NDwrit10
  3054. 10
  3055. LLSnt:s p]                                                                                                                                                                                                                                                                                W    OFit:10
  3056. ; writ10
  3057. 10
  3058. 10
  3059. 10
  3060. 10
  3061. 10
  3062. ±OT
  3063.     JMPh
  3064. wX
  3065.     PUwrit10
  3066. 10
  3067. 10
  3068. 10
  3069. 10
  3070. 10
  3071.  
  3072.     ADwrit10
  3073. 10
  3074. 10
  3075. 10
  3076. 10
  3077. 10
  3078. RNwrit10
  3079. 10
  3080. 10
  3081. linedel proc MOVStestBX10
  3082. 10
  3083. KITHEu 21h    in~loopof r    in[DREAD_fawrit10
  3084. 10
  3085. 10
  3086. KIs pTIONbo    init:10
  3087. 10
  3088. 10
  3089. 10
  3090. 10
  3091. RENT:m 2
  3092.     JN10
  3093. G    Dwrit10
  3094. 10
  3095. fasm 2 P    dwÅwrit10
  3096. 10
  3097. 10
  3098. _vedst COLUwrit10
  3099. xntwrit10
  3100. 10
  3101. 10
  3102. 10
  3103. 10
  3104. ng bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb0
  3105. 10
  3106. 10
  3107. 10
  3108. ,r"[10
  3109. 10
  3110. 10
  3111. 10
  3112. 10
  3113. 10
  3114. 10
  3115. 10
  3116. 10
  3117. 10
  3118. 10
  3119. 10
  3120. vedANDwrit10
  3121.     movL,Lon it:ta                                INTOe skeycall = C
  3122.     JNble::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  3123.     JMPfct    PU = C Peseeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee0
  3124. 10
  3125. I
  3126. sfewrit~ kDW    OF10
  3127. near
  3128.     eMOV    Hwrit    DSSUB    restwritdeled fffffffffffffffffffffffffffffffffffffffffffffffff0
  3129. BXH =                                                 0
  3130. "[ byyyyyyyyyyyyy
  3131.     Cffs≤E H,"s        ;;
  3132.     _enh LO10
  3133. F L, c,"EnMOal,p," ah,7OR
  3134.  
  3135. ;
  3136. t}rit    CAE_gsliact
  3137. ;
  3138. t    popar10
  3139. 10
  3140.     popET 
  3141. ;
  3142. t    popOW,read
  3143. ;
  3144. ; RgsDS
  3145. UNCatllFUNC
  3146.     JM
  3147. ;
  3148. tndoft
  3149. ;
  3150. ; extct allxiffh UTEll, ropcurr LO10
  3151.  touquen LO10
  3152.  HEp
  3153.     SUPs        ;n 8
  3154. ;
  3155. telayC    y____SUPEnC_c pe LO10
  3156. DL
  3157. ;
  3158. t10
  3159. 10
  3160. 10
  3161. IB LO10
  3162. ve,eædw    ofar10
  3163. 10
  3164. ENET ll den.dw    of ah,710
  3165. 10
  3166. 10
  3167. 10
  3168. 10
  3169. 10
  3170. alseli10
  3171. SUB    AHft
  3172.     JS
  3173. ;
  3174. talseOW,10
  3175. 10
  3176. 10
  3177. 10
  3178. 10
  3179. 10
  3180. alseTEDdelay
  3181. ;
  3182. tD ffs10
  3183. 10
  3184. D s        ;R
  3185.  
  3186. ;
  3187. t10
  3188. 10
  3189. R_
  3190. ;
  3191. t10
  3192. 10
  3193. 10
  3194. 10
  3195. D  ah,7of U    AL    OW,10
  3196. W    
  3197.     CAliSC
  3198. ;
  3199. tDW    OFar_P    OF LO10
  3200. ,3ou
  3201.     CAOW,        ; re
  3202. ;
  3203. tDW    OFDS
  3204.  
  3205.     Dvideo LO10
  3206. 100r i┼ft10
  3207.  
  3208.     DW    OFFSE┼xi; s
  3209. ;
  3210. tOP    , r10
  3211. of┼TED10
  3212. DE'    AL    ffs10
  3213. s of    AL    s        ; ou
  3214. ;
  3215. tlineC    are BX LO10
  3216. 10
  3217. 10
  3218. 10
  3219. 10
  3220.  
  3221.  
  3222. eIT    AL    ritURR
  3223. ;
  3224. t10
  3225. 10
  3226. 10
  3227. 10
  3228. 10
  3229. 10
  3230. resetBI LO10
  3231. 10
  3232. 10
  3233. KIOW, 100nd_dMDS
  3234. 10
  3235. ecar eFUNCEAD
  3236. ;
  3237. t10
  3238. 10
  3239. 10
  3240. 10
  3241. _vexi  CPA LOCOU k10
  3242. 10
  3243. 10
  3244. 10
  3245. 10
  3246. ,rffsLIN
  3247. ;
  3248. t,rs        ;½
  3249. ;
  3250. t,rC    µ LO10
  3251. ns FSET hi ah,7    CAhirit10
  3252. 44D0ar10
  3253. 10
  3254. 10
  3255. 10
  3256. 10
  3257. 8D0ET 10
  3258. sibdisabFUNC scMYD0DS
  3259. _ibs LO10
  3260. pciIV LO10
  3261. prCURREdisabxi    ;#l,7disab, r0H 
  3262. ;
  3263. t@TED
  3264.  e_fa LOffs10
  3265. ndo LOs        ;z tov d LO10
  3266. :
  3267.     movaw LO10
  3268. l    c
  3269. ;
  3270. t10
  3271.  ah,7har
  3272. ;
  3273. t10
  3274. 10
  3275. s10
  3276. 10
  3277. 10
  3278. elae:_fal pentre:keribSET_Ce:, Dm 
  3279. s}rousole.
  3280.  
  3281.